package com.example.chapter05;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


public class LoginMainActivity extends AppCompatActivity implements View.OnClickListener {

    TextView tv_pwd;
    Button btn_forget;
    EditText et_pwd;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_main);
        findViewById(R.id.rb_pwd).setOnClickListener(this);
        findViewById(R.id.rb_verifycode).setOnClickListener(this);
        tv_pwd = findViewById(R.id.tv_pwd);
        btn_forget = findViewById(R.id.btn_forget);
        et_pwd = findViewById(R.id.et_pwd);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rb_pwd:
                tv_pwd.setText("登录密码");
                btn_forget.setText("忘记密码？");
                et_pwd.setHint("请输入密码");
                break;
            case R.id.rb_verifycode:
                tv_pwd.setText("验证码");
                btn_forget.setText("获取验证码");
                et_pwd.setHint("请输入验证码");
                break;
            default:
                break;
        }
    }
}